class Parrot(object):
    
    def __init__(self):
        self._voltage = 10
 
    @property
    def voltage(self):
        """Get the current voltage."""
        return self._voltage * 2

pa = Parrot()
print pa.voltage

#setter not works! AttributeError: can't set attribute
#pa.voltage = 20

class Parrot2(object):
    
    def __init__(self):
        self._voltage = 100
 
    def get_voltage(self):
        """Get the current voltage."""
        return self._voltage
 
    def set_voltage(self, new_voltage):
        self._voltage = 2 * new_voltage
 
    voltage = property(get_voltage, set_voltage)
 
 
pa = Parrot2()
print pa.voltage
 
pa.voltage = 1000
print pa.voltage
